services:
  pyspark:
    container_name: pyspark
    build: ./jupyter
    hostname: pyspark
    links:
      - mongodb:mongodb
    ports:
      - 8888:8888
      - 4040:4040
    volumes:
      - ./workshop/:/home/jovyan

  mongodb:
    container_name: mongodb
    image: mongo:5.0.13
    ports:
      - 27017:27017

  postgres:
    container_name: postgres
    image: postgres:13
    restart: always
    environment:
      POSTGRES_PASSWORD: example
    ports:
      - "5432:5432"
    volumes:
      # uncomment if enable persist db
      #- ./pgData:/var/lib/postgresql/data
      - ./postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d

  akhq:
    container_name: akhq
    build: ./akhq
    ports:
      - 8081:8080
    volumes:
      - ./akhq/app/application.yml:/app/application.yml

  nifi:
    container_name: nifi_dev
    build: ./nifi
    ports:
      - 18443:18443
    volumes:
      - ./nifi/conf:/opt/nifi/nifi-current/conf
    environment:
      - NIFI_WEB_HTTPS_PORT=18443

  zookeeper:
      container_name: kafka-zookeeper
      image: confluentinc/cp-zookeeper:latest
      environment:
        ZOOKEEPER_CLIENT_PORT: 2181
        ZOOKEEPER_TICK_TIME: 2000
      ports:
        - 22181:2181

  kafka:
    container_name: kafka
    image: confluentinc/cp-kafka:latest
    depends_on:
      - zookeeper
    ports:
      - 29092:29092
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
